<template>
  <div class="main">
    <el-empty v-show="disSearchList.length === 0" :image-size="100"></el-empty>
    <el-table
        v-show="disSearchList.length !== 0"
        :data="disSearchList"
        style="width: 100%">
      <el-table-column
          label="病害id"
          width="200">
        <template slot-scope="scope">
          <i class="el-icon-paperclip"></i>
          <span style="margin-left: 10px">{{ scope.row.id }}</span>
        </template>
      </el-table-column>
      <el-table-column
          label="病害名称"
          width="200">
        <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row.disease_name }}</span>
        </template>
      </el-table-column>
      <el-table-column
          label="农作物类别"
          width="200">
        <template slot-scope="scope">
          <el-tag size="medium">{{ scope.row.crop_name }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
              size="mini"
              @click="handleEdit(scope.$index, scope.row)">查看详细信息</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import {mapMutations, mapState} from "vuex";

export default {
  name: "ShowSearchDisList",
  methods: {
    handleEdit(index, row) {
      this.SetShowDis(row)
    },
    ...mapMutations("disease",{SetShowDis:"SetShowDis"})
  },
  computed:{
    ...mapState('disease',['showDis','disSearchList'])
  }
}
</script>

<style scoped>
  .main{
    width: 80%;
    padding: 0 80px;
    margin: 0 auto;
    min-height: 100px;
  }
</style>